#include <iostream>
using namespace std;
string MONTH[]={"January", "February", "March", "April", "May", "June", "July", "August", "September","October", "November", "December"};
string WEEKEND[]={"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
int main()
{
	int year;
	string month;
	int day;
	while(cin>>day>>month>>year){
		int daysum=0;
		int M;
		int y;
		int C;
		int i;
		for(i=0;i<12;i++){
			if(MONTH[i]==month) break;
		}
		M=i+1;
		if(M==1||M==2){
			M += 12;
			C=(year-1)/100;
			y=(year-1)%100;
			daysum=C/4-2*C+y+y/4+13*(M+1)/5+day-1;
			while(daysum < 0) 
	        { 
	            daysum += 7; 
	        } 
			int index=daysum%7;
			cout<<WEEKEND[index]<<endl; 
		}
		else{
			C=year/100;
			y=year%100;
			daysum=C/4-2*C+y+y/4+13*(M+1)/5+day-1;
			while(daysum < 0) 
	        { 
	            daysum += 7; 
	        } 
			int index=daysum%7;
			cout<<WEEKEND[index]<<endl;
		} 
		
	}
	return 0;
} 
